package com.xiaohong.goodsWeb;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.security.web.firewall.HttpFirewall;
import org.springframework.security.web.firewall.StrictHttpFirewall;

/**
 * @author xiaohong
 * @Description
 * @date 20./21 0021 23:16
 */
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)  //排除掉数据库自动加载，因为这里不需要使用数据库
@EnableEurekaClient
@EnableFeignClients(basePackages = "com.xiaohong.goods.feign")
public class GoodsWebApplication {
    public static void main(String[] args) {
        SpringApplication.run(GoodsWebApplication.class,args);
    }


    /**
     * 解除//安全警告
     * @return
     */
    @Bean
    public HttpFirewall allowUrlDoubleSlashHttpFirewall() {
        StrictHttpFirewall firewall = new StrictHttpFirewall();
        firewall.setAllowUrlEncodedDoubleSlash(true);
        return firewall;
    }

}
